/**
 * SaverDXF.java ##copyright## This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by the Free Software
 * Foundation; either version 2.1 of the License, or (at your option) any later version. This
 * library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
 * General Public License for more details. You should have received a copy of the GNU Lesser
 * General Public License along with this library; if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 * 
 * @author ##author##
 * @modified ##date##
 * @version ##version##
 */

package fiveagon.saver;

import processing.core.PApplet;
import processing.core.PConstants;

/**
 * <code>Saver</code> for 3D graphics plus DXF recording. Saves PNG images and records DXF output.
 * 
 * <pre>
 * import processing.dxf.*;
 * import processing.opengl.*;
 * import processing.pdf.*;
 * </pre>
 */
public class SaverDXF extends AbstractSaver {
  /**
   * Constructor.
   * 
   * @param parent A reference to the <code>PApplet</code>. Usually the reference is passed using
   *        <code>this</code>.
   * @param userSavePrefix The desired filename prefix. If the prefix contains a folder separator,
   *        the desired folder is used. Otherwise, a default folder "print" will be used.
   */
  public SaverDXF(PApplet parent, String userStringPrefix) {
    super(parent, userStringPrefix);
  }

  @Override
  protected String abstractBeginRecord() {
    String filename = this.createFilename(".dxf");
    this.parent.beginRaw(PConstants.DXF, filename);

    return filename;
  }

  @Override
  protected void abstractEndRecord() {
    this.parent.endRaw();
  }

}
